<template>
  <div class="nav">
    <ul class="nav_1">
      <li @click="add"><van-icon name="wap-nav" size="25" /></li>
      <li><img :src="imgss" alt="" /></li>
      <li>{{ username }}</li>
      <li>Lv.{{ leave }}</li>
    </ul>
    <van-popup
      v-model="show"
      position="left"
      :style="{ height: '100%', width: '50vw' }"
    >
      <div class="user">
        <div class="user_img"><img :src="imgss" alt="" /></div>
        <div class="user_xq">
          <div class="user_gz">
            <div>{{ gz }}</div>
            <div>关注</div>
          </div>
          <div class="user_g"></div>
          <div class="user_fs">
            <div>{{ fs }}</div>
            <div>粉丝</div>
          </div>
        </div>
      </div>
      <van-divider />
    </van-popup>
  </div>
</template>

<script>
export default {
  props: {
    imgss: {
      default: require("../assets/logo.png"),
    },
    username: {
      default: "您说的对",
    },
    leave: {
      default: 0,
    },
    gz: {
      default: 0,
    },
    fs: {
      default: 0,
    },
  },
  data() {
    return {
      show: false,
    };
  },
  created() {},
  mounted() {
    this.$nextTick(function () {
    });
  },
  methods: {
    add() {
      this.show = true;
    },
  },
};
</script>

<style lang="scss" scoped>
.nav {
  position: fixed;
  z-index: 99;
  display: flex;
  align-items: center;
  height: 15vw;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  .nav_1 {
    display: flex;
    align-items: center;
    width: 100%;
    li {
      &:nth-child(1) {
        margin-left: 5vw;
      }
      &:nth-child(2) {
        margin-left: 5vw;
        img {
          width: 10vw;
          height: 10vw;
          background-color: black;
          border-radius: 10vw;
        }
      }
      &:nth-child(3) {
        margin-left: 5vw;
        font-weight: 700;
      }
      &:nth-child(4) {
        margin-left: 5vw;
        font-weight: 700;
      }
    }
  }
  .user {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 6vw;

    .user_xq {
      display: flex;
      width: 100%;
      justify-content: space-evenly;
      text-align: center;
      margin-top: 6vw;
    }
    .user_img {
      img {
        width: 20vw;
        height: 20vw;
        border-radius: 20vw;
      }
      overflow: hidden;
    }

    .user_g {
      // border: 1px solid black;
      width: 1px;
      height: 40px;
      background-color: black;
    }
  }
}
</style>